package com.zhongkun.datahome.service.constant;

import lombok.Getter;

/**
 * @Author: lifengsheng
 * @Date: 2025/4/24 14:06
 * @Desc
 */
@Getter
public enum MaterialChannelEnum {
    DEVELOPER(0, "开发商"),
    CUSTOMER(1, "客户自理");

    private Integer channel;
    private String name;

    MaterialChannelEnum(Integer channel, String name) {
        this.channel = channel;
        this.name = name;
    }

    public static Integer getByName(String name) {
        for (MaterialChannelEnum channelEnum : MaterialChannelEnum.values()) {
            if (channelEnum.getName().equals(name)) {
                return channelEnum.getChannel();
            }
        }

        return DEVELOPER.channel;
    }
}
